//
//  NSMutableAttributedString+Extension.swift
//  mapbox
//
//  Created by linzaifei on 2023/8/8.
//

import Foundation
enum Position {
    case left
    case right
}

extension NSMutableAttributedString {
    
//    static func layout(imageName:String,text:String,
//              imageFont:UIFont = UIFont.systemFont(ofSize: 15),
//              color:UIColor = UIColor.jk_color(withHexString: "#8e8e8e"),
//              textFont:UIFont = UIFont.systemFont(ofSize: 13),
//              size:CGSize = CGSize.init(width: 13, height: 13),
//              position:Position = Position.left
//    )->NSMutableAttributedString {
//        
//        let attachment = NSMutableAttributedString.yy_attachmentString(withContent: UIImage.init(named: imageName), contentMode: UIView.ContentMode.scaleAspectFill, attachmentSize: size, alignTo: imageFont, alignment: YYTextVerticalAlignment.center)
//        let textStr = NSMutableAttributedString.init(string: text)
//        textStr.yy_font = textFont
//        textStr.yy_color = color
//        if position == Position.left {
//            attachment.append(textStr)
//            return attachment;
//        }
//        textStr.append(attachment)
//        return textStr;
//    }
//    
//    static func layout(imageName:String,text:String)-> NSMutableAttributedString{
//        return  layout(imageName: imageName, text: text,imageFont: UIFont.systemFont(ofSize: 14),color: UIColor.colorType(light: ZFColorType.color_99, dark: ZFColorType.color_99),textFont: UIFont.systemFont(ofSize: 13));
//    }
//    
//    static func drawOutlineAttributedString(string: String,fontSize: CGFloat = 15,alignment: NSTextAlignment = .center,textColor: UIColor,strokeWidth: CGFloat,strokeColor: UIColor) -> NSAttributedString {
//        let paragraph = NSMutableParagraphStyle()
//        paragraph.alignment = alignment
//        paragraph.lineHeightMultiple = 0.93
//        let dic: [NSAttributedString.Key: Any] = [
//            NSAttributedString.Key.font: UIFont.systemFont(ofSize: fontSize),
//            NSAttributedString.Key.paragraphStyle: paragraph,
//            NSAttributedString.Key.foregroundColor: textColor,
//            NSAttributedString.Key.strokeWidth: strokeWidth,
//            NSAttributedString.Key.strokeColor: strokeColor,
//            NSAttributedString.Key.kern: 1
//        ]
//        var attributedText: NSMutableAttributedString!
//        attributedText = NSMutableAttributedString(string: string, attributes: dic)
//        return attributedText
//    }
    

}
